<%@ page import="javax.naming.*"%> 

<%!
    private exoEcho.session.echoItf converter = null;

	public void jspInit() {
        try {
		InitialContext ctx = new InitialContext();		
		converter = (exoEcho.session.echoItf) ctx.lookup("leRepeteur");
        } catch (Exception ex) {
            System.out.println("erreur dans le lookup."+ ex.getMessage());
        }
    }

    public void jspDestroy() {
        converter = null;
    }
%>
<html>
    <head>
        <title>Le programme qui repete dollar</title>
    </head>

    <body bgcolor="white">
        <h1>On va repeter</h1>
        <hr>
        <p>Entrer la phrase  :</p>
        <form method="post">
            <input type="text" name="lasaisie" size="25">
            <br>
            <p>
            <input type="submit" value="Submit">
            <input type="reset" value="Reset">
        </form>

        <%
            String txt = request.getParameter("lasaisie");
			
			if ( txt != null && txt.length() > 0 ) {
				String result = converter.echo(txt);
        %>
		
		<%= result %>
		<% } %>
		
    </body>
</html>
